package net.rlair.sbdemo.controller;

import net.rlair.sbdemo.ContextUtils;
import net.rlair.sbdemo.dao.mybatis.bootmapper.UserMapper;
import net.rlair.sbdemo.service.TxRequiresNewZhaoyuyang;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @author lixudong
 */
@Controller
@RequestMapping("zhaoyuyang")
public class ZhaoyuyangController {

    @Resource
    private UserMapper userMapper;

    @Resource
    private TxRequiresNewZhaoyuyang txRequiresNewZhaoyuyang;

    @Resource
    private ContextUtils contextUtils;

    @GetMapping("list")
    @ResponseBody
    public Object list() {
        return userMapper.selectUser();
    }


    @GetMapping("add")
    @ResponseBody
    public int add() {
        return txRequiresNewZhaoyuyang.batchAddUsers();
    }
}